package edu.ustb.gateway.entity;

/**
 * @author ShiZhe
 * @create 2021-04-10 18:51
 * 定义发送给总线的服务调用的信息的Json包含的字段
 */
public class MessageMq {

    /**
     * 与返回号对应（response ID）
     */
    private Long askId;
    /**
     * 消费者唯一识别id
     */
    private Long consumerId;
    /**
     * 最终调用服务名称
     */
    private String endpointService;
    /**
     * 调用路径
     */
    private String serviceAction;
    /**
     * 请求参数
     */
    private String actionParams;
    /**
     * 合约唯一ID
     */
    private String contractId;
    /**
     * 回调地址，接收返回结果，指定总线交换机，这个在配置文件中配置
     */
    private String callbackUrl;
//    /**
//     * 判断ask_id是否使用过
//     * 0：表示未匹配
//     * 1：表示已匹配
//     */
//    private Integer used;

    public Long getAskId() {
        return askId;
    }

    public void setAskId(Long askId) {
        this.askId = askId;
    }

    public Long getConsumerId() {
        return consumerId;
    }

    public void setConsumerId(Long consumerId) {
        this.consumerId = consumerId;
    }

    public String getEndpointService() {
        return endpointService;
    }

    public void setEndpointService(String endpointService) {
        this.endpointService = endpointService;
    }

    public String getServiceAction() {
        return serviceAction;
    }

    public void setServiceAction(String serviceAction) {
        this.serviceAction = serviceAction;
    }

    public String getActionParams() {
        return actionParams;
    }

    public void setActionParams(String actionParams) {
        this.actionParams = actionParams;
    }

    public String getContractId() {
        return contractId;
    }

    public void setContractId(String contractId) {
        this.contractId = contractId;
    }

    public String getCallbackUrl() {
        return callbackUrl;
    }

    public void setCallbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
    }

//    public Integer getUsed() {
//        return used;
//    }
//
//    public void setUsed(Integer used) {
//        this.used = used;
//    }
}


//{
////与返回号对应（response ID），随机生成
//        "ask_id":3924073778634222211,
////服务消费者，注册为用户时，会产生一个唯一标识的id，当尝试调用服务时，调用连接会附带上此id
//        "Consumer_id":390351315,
////最终调用服务名
//        "endpoint_service":"railwayticket",
////动作，即请求路径
//        "service_action":"/railwayticket/api/v1/ticket/issue",
////动作参数，附带token或者密码，进行验证等操作
//        "action_params":{
//          "token":1,
//          "password":123
//        },
////合约地址，
//        "contract_id":"DC4A5353DCEE4594DAC9C8EE847BC2283E7D09D1",
////回调地址，接收返回结果，指定总线交换机
//        "callback_URL":"gatewayExchange"
//        }